import {createRouter, createWebHistory} from 'vue-router'
import menus from "./menus.js";

const router = createRouter({
    history: createWebHistory(import.meta.env.JPAAS_BASE_URL),
    routes: [
        {
            path: '/',
            props: true,
            component: () => import('../layouts/main-layout.vue'),
            children:menus
        },
        {
            path: '/design/:pkId',
            name: 'design',
            component: () => import('@/views/modules/design/index.vue')
        },
        {
            path: '/preview/:alias',
            name: 'preview',
            component: () => import('@/views/modules/preview/index.vue')
        },
        /**
         * encryParams 为加密参数
         * {
         *     alias:别名,
         *     publicity:默认false 是否对外公开,
         *     userId:分享人ID
         * }
         */
        {
            path: '/share/:encryParams',
            name: 'share',
            component: () => import('@/views/modules/preview/share-preview.vue')
        },
        {
            path: '/mobile/:alias',
            name: 'mobile',
            component: () => import('@/views/modules/preview/mobile/index.vue')
        },
    ]
})
export default router
